//
//  YahooWeatherDataTest.m
//  WeatherDesktop
//
//  Created by Justin Dell on 10/26/08.
//  Copyright 2008 . All rights reserved.
//

#import "YahooWeatherDataTest.h"

static NSString *testZip = @"99999";

@implementation YahooWeatherDataTest

- (void) setUp {
    yahooData = [[YahooWeatherData alloc] init];
}

- (void) tearDown {
    [yahooData release];
}

- (void) testFetch {
    printf("Testing fetch\n");
    NSInteger error = [yahooData fetchDataWithZip:testZip];
    STAssertEquals(0, error, @"Fetched data should not return error");
    STAssertEquals([yahooData getCode], 26, @"Could not fetch code. 26 != %d", [yahooData getCode]);
}

- (void) testPicture {
    printf("Testing picture\n");
    STAssertEquals([yahooData getPicture], @"", @"Picture file should be empty");
    [yahooData fetchDataWithZip:testZip];
    STAssertEquals([yahooData getPicture], @"cloudy.jpg", 
        @"Picture file does not match: cloudy.jpg != %@", [yahooData getPicture]);
}

@end
